﻿@using pageRes = FlashCards.WebApp.Resources.PageResources
@model System.Collections.Generic.List<FlashCards.WebApp.Models.GroupModel>
@{
    ViewBag.Title = pageRes.Groups;
}
<h2>
    @pageRes.Groups</h2>
@if (Model != null && Model.Count > 0)
{
    foreach (var group in Model)
    {
    <div class="content-center">
        <h5>@Html.DisplayFor(x => group.Name)</h5>
        <div class="c-left">
            @if (group.IsHidden)
            {
                @pageRes.GroupHidden
            }
            else
            { 
                @pageRes.GroupPublic
            }
            <div>
                @Html.Label(pageRes.GroupFlashcardsSetsCount)
                @Html.DisplayFor(x => group.FlashcardSetsCount)
            </div>
            <div>
                @Html.ActionLink(pageRes.GroupViewFlashcardsSets, "ViewGroupFlashcardSets", new { groupId = group.GroupId })
            </div>
        </div>
        <div class="c-right">
            @Html.Label(pageRes.GroupMembersCount)
            @Html.DisplayFor(x => group.MembersCount)
            <br />
            @Html.ActionLink(pageRes.GroupMembers, "ViewGroupMembers", new { groupId = group.GroupId })
        </div>
        <div class="clear" ></div>
    </div>
    }
}
else
{
    <p>
        You are not a member of any group</p>
}
@Html.ActionLink(pageRes.GroupCreateNew, "CreateGroup", "Groups")
